import 'vux/src/styles/reset.less';
import './help.scss'
import {
  Swiper,
  Scroller,
  Tab,
  TabItem,
  Sticky,
  Flexbox,
  FlexboxItem,
  ViewBox,
  XButton,
  Group
} from 'vux'

import {
  hostImg
} from 'js/host-config'
import {
  fetch,
  rap
} from 'js/fetch.js'

import utils from 'js/utils.js'
import {
  cookie
} from 'vux'
let url = {
  getCategories: 'api/book/categories',
  getBooks: 'api/books'
}
url = rap(url)
import Myhead from 'components/head/head.vue'
// import Slide from 'components/slide/slide.vue'
import Top from 'components/top/top.vue'
// import Search from 'components/search/search.vue'
import Foot from 'components/foot/foot.vue'

import Booklist from 'components/booklist/booklist.vue'

import mixin from 'js/mixin.js'

new Vue({
  el: '#body',
  data: {
    type: 'classlist',
    categoriesList: [],
    bookList: [],
    bannerList: [{
      url: 'javascript:',
      img: '/static/banner.jpg',
    }, {
      url: 'javascript:',
      img: '/static/banner.jpg',
    }, {
      url: 'javascript:',
      img: '/static/banner.jpg',
      fallbackImg: 'https://static.vux.li/demo/3.jpg'
    }],
    listIndex: 0,
    transitionName: 'slide-left',
    mylist: [], //临时存放
    category_id: 0,
    token: '',
    search: '',
    show: false
  },
  created() {

  },
  methods: {
    back() {
      window.location.href = './register.html'
    },
    goDetail(id) {
      window.location.href = `./books_detail.html?id=${id}`
    },
  },
  components: {
    Group,
    XButton,
    Swiper,
    Scroller,
    Tab,
    TabItem,
    Sticky,
    Flexbox,
    FlexboxItem,
    ViewBox,
    Booklist
  },
  mixins: [mixin]
})
